﻿using System;
using System.ServiceModel;
using WcfServiceShared;

namespace WcfServiceLibrary1
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("---------------------------------------------------------------------");
            Console.WriteLine("This is the WCF Service hosting within a console application");
            Console.WriteLine("The service can also be hosted with a web browser");
            Console.WriteLine("");
            Console.WriteLine("Initializing WCF Service...");

            // The service configuration is loaded from app.config
            using (var host = new ServiceHost(typeof(Service)))
            {
                host.Open();

                Console.WriteLine("WCF Service is ready for requests." +
                                  "Press any key to close the service.");
                Console.WriteLine();
                Console.Read();

                Console.WriteLine("Closing service...");
            }
        }
    }
}